﻿{include file="public/header"}
<title>订单录入</title>
</head>
<body>


<article class="page-container">
    <form action="" method="post" class="form form-horizontal" id="form-member-add">
        <div class="ch-row ch-info-form">
            <p class="flex1">供应商名称：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="" name="agency_name" placeholder="请输入供应商名称">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">供应商类型：</p>
            <div class="flex2">
                <select name="range" class="ch-info-select form-control">
                    <option value="0">请选择</option>
                    <option value="1">主材供应商</option>
                </select>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">公司地址：</p>
            <div class="flex2">
                <div class="ch-pc-row">
                    <select name="province" class="ch-info-select form-control province" onmouseover="privance()">
                        <option selected="selected" value="">请输入地址</option></select>
                    <select name="citys" class="ch-info-select form-control city"><option selected="selected" value="">请输入地址</option></select>
                    <select name="area" class="ch-info-select form-control area"><option selected="selected" value="">请输入地址</option></select>
                </div>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">供应范围：</p>
            <div class="flex2">
               <select name="business" class="ch-info-select form-control">
                   {volist name='supply' id='vo'}
                   <option  value="{$vo.id}">{$vo.title}</option>
                   {/volist}

               </select>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">主供商品备注：</p>
            <div class="flex2">
                <textarea type="text" class="form-control fid"  name="product_notes" placeholder="请输入主供商品备注">
                </textarea>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">所属城市：</p>
            <div class="flex2">
                <div class="ch-pc-row">
                    <select name="belonging_to" class="ch-info-select form-control">
                        <option selected="selected" value="">请输入地址</option>
                        {volist name='city' id='vo'}
                        <option  value="{$vo.city_id}">{$vo.city}</option>
                        {/volist}
                    </select>
                </div>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 业务范围：</p>
            <div class="flex2">
                <div class="ch-pc-row">
                    <select name="scope_business" class="ch-info-select form-control ">
                        <option selected="selected" value="">请输入地址</option>
                        {volist name='city' id='vo'}
                        <option  value="{$vo.city_id}">{$vo.city}</option>
                        {/volist}
                    </select>
                </div>
            </div>
        </div>

        <div class="ch-row ch-info-form">
            <p class="flex1">联系人：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="" name="contacts" placeholder="请输入联系人">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 联系电话：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="" name="telephone" placeholder="请输入联系电话">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 收款账户类型：</p>
            <div class="flex2">
                <input type="radio" name="account_type" value="2">个人账户
                &nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio"  name="account_type" value="1">对公账户
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 收款账户名称：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="" name="collection_name" placeholder="请输入收款账户名称">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1"> 收款账号：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="" name="collection_number" placeholder="请输入收款账号">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">  收款银行：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="" name="bank" placeholder="请输入收款银行">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">   开户行：</p>
            <div class="flex2">
                <input type="text" class="form-control fid" value="" name="bank_of_deposit" placeholder="请输入开户行">
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <p class="flex1">   状态：</p>
            <div class="flex2">
               <input type="radio" name="state" value="0">冻结
                &nbsp;&nbsp;&nbsp;&nbsp;
               <input type="radio"  name="state" value="1">正常
            </div>
        </div>

        <div class="ch-row">
            <div class="flex1">
                <button class="btn btn-primary radius" type="button" style="width: 100%;"><i class="Hui-iconfont">&#xe632;</i> 提交</button>
            </div>
        </div>

    </form>
</article>
{include file="public/footer"}

</body>
<script>
    $('.radius').click(function () {
        var src="{:Url('index/Agency/add')}?city="+ (getCookie('token').split('.'))[1];
        $(this).attr('disabled',true);
        $.ajax({
            type: 'POST',
            url: src,
            dataType: 'json',
            data:$('form').serializeArray(),
            success: function (data) {
                var res=JSON.parse(data);
                $('.radius').attr("disabled",false);
                if(res.code==200){
                    layer.msg(res.msg, {icon: 1, time: 2000}, function (index,layero) {
                        parent.location.reload()
                    });
                }else{
                    layer.msg(res.msg,{icon: 5,time:1000});
                }

            },
            error: function (data) {
                console.log(data.msg);
            },
        });

    });
</script>
</html>
